export default () => {
  const add = (data: KeyPersonModel) => {
    window.api.sql(
      `insert into keypersons (gongxu,compId,name,zhiwu,iCard,remark,created_at) values (@gongxu,@compId,@name,@zhiwu,@iCard,@remark,datetime())`,
      'insert',
      {
        gongxu: data.gongxu,
        compId: data.compId,
        name: data.name,
        zhiwu: data.zhiwu,
        iCard: data.iCard,
        remark: data.remark
      }
    )
  }

  return { add }
}
